<?php /* Smarty version 2.6.18, created on 2010-03-24 08:39:11
         compiled from selectsupplier.tpl */ ?>

<form name="supplierForm" id="supplierForm">
<input type="hidden" name="organism_id" value="<?php echo $this->_tpl_vars['organism_id']; ?>
">
<input type="hidden" name="key" value="<?php echo $this->_tpl_vars['key']; ?>
">
<input type="hidden" name="gender" value="<?php echo $this->_tpl_vars['gender']; ?>
">
<input type="hidden" name="size" value="<?php echo $this->_tpl_vars['size']; ?>
">
<input type="hidden" name="currency" value="<?php echo $this->_tpl_vars['currency']; ?>
">
<input type="hidden" name="amount" value="<?php echo $this->_tpl_vars['amount']; ?>
">
<table class="popup" border="0" cellspacing=0 cellpadding=0>
	<tr><td><div class="pop"><div class="top_pop"><img src="/app/default/www/images/top_left_pop.jpg" /></div> 
		<div id="drag_bar"><h2 class="pop_h2">&nbsp;&nbsp;Supplier</h2></div>
		<div class="content">
			<b>MOID : </b><?php echo $this->_tpl_vars['suppliers'][0]['moid']; ?>
<br>
			<b>Scientific Name :</b> <i><?php echo $this->_tpl_vars['suppliers'][0]['scientific_name']; ?>
</i><br>
			<b>Name : </b><?php echo $this->_tpl_vars['suppliers'][0]['name']; ?>
<br>	
			<b>Price : </b><?php echo $this->_tpl_vars['currency']; ?>
 <?php echo $this->_tpl_vars['amount']; ?>
<br>			
			<table border="0" width="100%">
				<tr>
					<td width="50%">Supplier</td>
					<td align="center">Qty.</td>
					<td align="center">Size</td>
				</tr>
				<tr><td colspan="3"><hr></td></tr>
				
				<?php $_from = $this->_tpl_vars['suppliers']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['supplier']):
?>
				<?php $this->assign('index', ($this->_tpl_vars['size'])."_".($this->_tpl_vars['gender'])); ?>
				<?php $this->assign('suppkey', ($this->_tpl_vars['supplier']['org_id'])); ?>
				<tr>
					<td><?php echo $this->_tpl_vars['supplier']['supplier']; ?>
</td>
					
					<td align="center"><input type="text" style="width:50px" name="user[supplier_<?php echo $this->_tpl_vars['supplier']['org_id']; ?>
_<?php echo $this->_tpl_vars['key']; ?>
_<?php echo $this->_tpl_vars['supplier']['org_organism_id']; ?>
]" value="<?php echo $this->_tpl_vars['order'][$this->_tpl_vars['suppkey']][$this->_tpl_vars['index']]; ?>
"></td>
					<td align="center">												
						<?php $_from = $this->_tpl_vars['sizearray']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['item']):
?>
							<?php if ($this->_tpl_vars['size'] == $this->_tpl_vars['item']['size_code']): ?>
								<input type="hidden" name="user[size_<?php echo $this->_tpl_vars['supplier']['org_id']; ?>
_<?php echo $this->_tpl_vars['key']; ?>
_<?php echo $this->_tpl_vars['supplier']['org_organism_id']; ?>
]" value="<?php echo $this->_tpl_vars['item']['size_code']; ?>
"> 
								<?php echo $this->_tpl_vars['item']['size']; ?>

								<?php if ($this->_tpl_vars['gender'] <> ""): ?>
									(<?php echo $this->_tpl_vars['gender']; ?>
)
								<?php endif; ?>
							<?php endif; ?>
						<?php endforeach; endif; unset($_from); ?>
					</td>
				</tr>
				<tr><td colspan="3"><hr></td></tr>
				
				<?php endforeach; endif; unset($_from); ?>
				<tr><td height="10"></td></tr>
				<tr>
					<td colspan="3" align="center">
						<input id="btnBack" name="btnBack" type="button" value="&lt;&lt;Back" onclick="onCancel()">&nbsp;
						<input id="btnSave" name="btnSave" type="button" value="Save" onclick="saveSelectedSupplier();">
					</td>
				</tr>
			</table>
	</div>	
	<div class="btm_pop"><img src="/app/default/www/images/btm_left_pop.jpg"  alt="" />
	</td></tr>
</table>
</form>
<div id="test">

</div>
<script type="text/javascript">
<?php echo '

	function saveSelectedSupplier(){
		sForm = document.getElementById(\'supplierForm\');
		doajaxAction(\'/account/saveorder/special_order/'; ?>
<?php echo $this->_tpl_vars['special_order']; ?>
<?php echo '\',1,\'test\',sForm,false);
		popup(\'supplier\');
	}
	
	function onSubmit() {
		sForm = document.getElementById(\'supplierForm\');
		doajaxAction(\'/account/saveorder/special_order/'; ?>
<?php echo $this->_tpl_vars['special_order']; ?>
<?php echo '\',1,\'\',sForm,true);
		
		popup(\'supplier\');
	}
	function onCancel() {
		popup(\'supplier\');
	}
	
	//ekimo_button("btnBack", onCancel);
	//ekimo_button("btnSave", onSubmit);
'; ?>

</script>
